
namespace Stee.CAP8.MessageBus.Sample.Factories
{
    using System;
    using System.Collections.Generic;
    using Stee.CAP8.MessageBus.Interface.Interfaces;
    using Stee.CAP8.MessageBus.Interface.Models;

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TConfig"></typeparam>
    public class MessageBusFactory<TConfig> : IMessageBusFactory<TConfig>
    {
        /// <summary>
        /// 
        /// </summary>
        public bool IsInitialized { get; private set; }


        /// <summary>
        /// Initialize the message bus factory
        /// </summary>
        /// <param name="username">Username, nullable</param>
        /// <param name="password">Password, nullable</param>
        /// <param name="brokerConfigurations">Broker configurations: topic list, groups, other detailed settings, nullable</param>
        public void Initialize(string username, string password, TConfig brokerConfigurations)
        {
            try
            {

            }
            catch (Exception)
            {

            }
        }

        /// <summary>
        /// Register/create new subscriber
        /// </summary>
        /// <typeparam name="TMsgType">Message type</typeparam>
        /// <param name="topicName">Topic name</param>
        /// <param name="configurationProperties">Configuration mappings to property name. Eg: "BootstrapServers" => "127.0.0.1:9092"</param>
        /// <returns>Return new subscriber</returns>
        public ISubscriber<TMsgType> RegisterSubscriber<TMsgType>(TopicName topicName, Dictionary<string, string> configurationProperties)
        {
            try
            {
                ISubscriber<TMsgType> subscriber = null;


                return subscriber;
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
